package br.com.fpf.pontoapp.model.constant;

import br.com.fpf.pontoapp.R;

/**
 * The Enum OccurrenceConst.
 * 
 * @author irlan.gomes
 */
public enum OccurrenceConst {

	/** The delay. */
	DELAY(1, R.string.delay),

	/** The output. */
	OUTPUT(2, R.string.output),

	/** The private purpose. */
	PRIVATE_PURPOSE(3, R.string.private_purpose),

	/** The not registered point. */
	NOT_REGISTRATION_POINT(4,  R.string.not_reg_point),

	/** The absence. */
	ABSENCE(5, R.string.absence),

	/** The field service. */
	FIELD_SERVICE(6, R.string.field_service),

	/** The not registration occurrence. */
	NOT_REGISTRATION_OCCURRENCE(7, R.string.not_reg_occurrence);

	/** The id. */
	private int id;

	/** The resource. */
	private int resource;

	/**
	 * Instantiates a new occurrence const.
	 * 
	 * @param id
	 *            the id
	 * @param resource
	 *            the resource
	 */
	private OccurrenceConst(int id, int resource) {
		this.id = id;
		this.resource = resource;
	}

	/**
	 * Gets the occurrence const.
	 * 
	 * @param id
	 *            the id
	 * @return the occurrence const
	 */
	public static OccurrenceConst getOccurrenceConst(int id) {

		OccurrenceConst result = OccurrenceConst.NOT_REGISTRATION_OCCURRENCE;

		for (OccurrenceConst item : values()) {
			if (id == item.getId()) {
				result = item;
			}
		}

		return result;
	}

	/**
	 * Gets the id.
	 * 
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * Gets the resource.
	 * 
	 * @return the resource
	 */
	public int getResource() {
		return resource;
	}

}
